package view;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.event.ActionListener;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JPanel;

/**
 * THis is the panel in the GamePanel that holds the pause button.
 * Simply allows the user to pause the game when pressed.
 * 
 * @author Stephanie
 *
 */
public class PausePanel extends JPanel {
	
	private JButton pauseButton;
	private Image img;
	
	public PausePanel() {
		setSize(200,50);
		setLocation(600,550);
		setVisible(true);
		setLayout(null);
		
		img = new ImageIcon("images/PausePanel.jpg").getImage();
		
		pauseButton = new JButton("Pause");
		pauseButton.setSize(100,30);
		pauseButton.setLocation(50,10);
		pauseButton.setBackground(Color.BLACK);
		pauseButton.setForeground(Color.RED);
		pauseButton.setVisible(true);
		
		add(pauseButton);
	}
	
	protected void paintComponent(Graphics g)
	{
		//g.setColor(Color.BLACK);
		//g.fillRect(0, 0, getWidth(), getHeight());
		g.drawImage(img,0,0,null);

	}
	
	public void addPauseListener( ActionListener listener ) {
		pauseButton.addActionListener( listener );
	}

}